function UpdateOrAddTFCFileInDatabase( filename, subjects, conditions, frequencybins, baselinesettings, times )
%UPDATEORADDTFCFILEINDATABASE Summary of this function goes here
%   Detailed explanation goes here


global Database;

cFilename = strcmp(Database.tfc_header, 'Filename');
cSubjects = strcmp(Database.tfc_header, 'Subjects');
cConditions = strcmp(Database.tfc_header, 'Conditions');
cFrequencyBins = strcmp(Database.tfc_header, 'FrequencyBins');
cBaselineSettings = strcmp(Database.tfc_header, 'BaselineSettings');
cTimes = strcmp(Database.tfc_header, 'Times');

rFilename = strcmp(Database.tfc(:, cFilename), filename);
if ~any(rFilename)
    Database.tfc{end+1, cFilename} = filename;
    rFilename = size(Database.tfc, 1);
end
Database.tfc{rFilename, cSubjects} = subjects;
Database.tfc{rFilename, cConditions} = conditions;
Database.tfc{rFilename, cFrequencyBins} = frequencybins;
Database.tfc{rFilename, cBaselineSettings} = baselinesettings;
Database.tfc{rFilename, cTimes} = times;

SaveTable('tfc');
end

